Skip to content

Add model allow/deny policy helpers to ai-config - #92

Closed
melissa-barca wants to merge 5 commits into
mainfrom
bugfix-core-allow-deny-model-policy
Closed

Add model allow/deny policy helpers to ai-config#92
melissa-barca wants to merge 5 commits into
mainfrom
bugfix-core-allow-deny-model-policy

Conversation

@melissa-barca

@melissa-barca melissa-barca commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

First piece of posit-dev/positron#15417

Adds helpers to ai-config that let a host application check whether a model ID is allowed under a provider's configured allow/deny policy, resolve a full list of model IDs through that policy, and check whether a provider should run discovery at all.

ai-config's package root now exports these helpers alongside resolveModels.

Expose pure ai-config helpers for resolving model IDs, checking discovery policy, and filtering discovered model rows through the existing model resolver pipeline.
Keep model policy helpers on the package root export instead of maintaining a duplicate public subpath.
Document that discovery policy drops discovered IDs only and custom models still participate in model ID resolution.
Treat same-id custom model declarations as replacements for discovered model entries, preserving discovered optional metadata that the custom declaration does not set. Remove the discovered-row filter helper that encoded the opposite assumption.
Keep resolveModels's existing pipeline unchanged: a custom model
declaration and a discovered model sharing an id remain separate
candidates, as on main. The new policy helpers wrap that pipeline
as-is rather than changing what it does with a same-id collision.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant